/*
 * Copyright © 2022 XXXXXXXXX
 * @Author: zhangxiang
 * @Date: 2022-07-19 09:42:10
 * @LastEditors: zhangxiang
 * @LastEditTime: 2023-04-13 16:45:24
 * @Description:
 *
 */

import Layout from '@/layout'

/**
 * @description: 智能调度路由
 * @return {*}
 */
const cnResourceRouter = {
  path: '/cn-resource', // 根路径
  component: Layout,
  redirect: '/cn-resource/network', // 重定向
  name: 'CNResource', // 名称
  meta: {
    title: '算力资源管理', // 标题
    menuNameKey: 'CNResource',
    icon: 'cn-resource' // icon
  },
  children: [
    {
      path: 'network', // 路径
      component: () => import('@/views/cn-resource/network/index'),
      name: 'NetMgmt', // 路由跳转name
      redirect: '/cn-resource/network/public',
      meta: {
        title: '网络管理',
        menuNameKey: 'NetMgmt',
        icon: '',
        menuKey: 'NetMgmt'
      },
      children: [
        {
          path: 'public', // 路径
          name: 'NetMgmtPublic', // 路由跳转name
          component: () => import('@/views/cn-resource/network/public'), // 视图对应的组件
          meta: {
            menuNameKey: 'NetMgmtPublic',
            title: '专有网络VPC' // 标题
          }
        },
        {
          path: 'private', // 路径
          name: 'NetMgmtPrivate', // 路由跳转name
          component: () => import('@/views/cn-resource/network/private'), // 视图对应的组件
          meta: {
            menuNameKey: 'NetMgmtPrivate',
            title: '网络' // 标题
          }
        }
      ]
    },
    {
      path: 'subnet', // 路径
      component: () => import('@/views/cn-resource/subnet'),
      name: 'SubNetMgmt', // 路由跳转name
      meta: {
        title: '子网管理',
        menuNameKey: 'SubNetMgmt', icon: '', menuKey: 'SubNetMgmt'
      }
    },
    {
      path: 'nsg', // 路径
      component: () => import('@/views/cn-resource/nsg'),
      name: 'NSGMgmt', // 路由跳转name
      meta: {
        title: '安全组管理',
        menuNameKey: 'NSGMgmt', icon: '', menuKey: 'SecurityGroupMgmt'
      }
    },
    {
      path: 'nsg/rule', // 路径
      component: () => import('@/views/cn-resource/nsg/rule'),
      name: 'NSGMgmtRule', // 路由跳转name
      hidden: true,
      meta: {
        title: '规则配置',
        icon: '',
        menuKey: 'SecurityGroupMgmt',
        activeMenu: '/cn-resource/nsg'
      }
    },
    {
      path: 'vm', // 路径
      component: () => import('@/views/cn-resource/vm'),
      name: 'VMMgmt', // 路由跳转name
      meta: {
        title: '虚拟机管理',
        menuNameKey: 'VMMgmt', icon: '', menuKey: 'VMMgmt'
      }
    },
    {
      path: 'storage', // 路径
      component: () => import('@/views/cn-resource/storage/index'),
      name: 'CloudStorageMgmt', // 路由跳转name
      redirect: '/cn-resource/storage/block',
      meta: {
        title: '云存储管理',
        menuNameKey: 'CloudStorageMgmt', icon: '', menuKey: 'CloudStorageMgmt'
      },
      children: [
        {
          path: 'block', // 路径
          name: 'CloudStorageMgmtBlock', // 路由跳转name
          component: () => import('@/views/cn-resource/storage/block'), // 视图对应的组件
          meta: {
            menuNameKey: 'CloudStorageMgmtBlock',
            title: '块存储' // 标题
          }
        },
        {
          path: 'object', // 路径
          name: 'CloudStorageMgmtObject', // 路由跳转name
          component: () => import('@/views/cn-resource/storage/object'), // 视图对应的组件
          meta: {
            menuNameKey: 'CloudStorageMgmtObject',
            title: '对象存储' // 标题
          }
        },
        {
          path: 'file', // 路径
          name: 'CloudStorageMgmtFile', // 路由跳转name
          component: () => import('@/views/cn-resource/storage/file'), // 视图对应的组件
          meta: {
            menuNameKey: 'CloudStorageMgmtFile',
            title: '文件存储' // 标题
          }
        }
      ]
    },
    {
      path: 'elastic-ip', // 路径
      component: () => import('@/views/cn-resource/elastic-ip'),
      name: 'ElasticIP', // 路由跳转name
      meta: {
        title: '弹性IP',
        menuNameKey: 'ElasticIP', icon: '', menuKey: 'ElasticIP'
      }
    },
    {
      path: 'float-ip', // 路径
      component: () => import('@/views/cn-resource/float-ip'),
      name: 'FloatIP', // 路由跳转name
      meta: {
        title: '浮动IP',
        menuNameKey: 'FloatIP', icon: '', menuKey: 'FloatIP'
      }
    },
    {
      path: 'route', // 路径
      component: () => import('@/views/cn-resource/route'),
      name: 'RouteMgmt', // 路由跳转name
      meta: {
        title: '路由管理',
        menuNameKey: 'RouteMgmt', icon: '', menuKey: 'RouteMgmt'
      }
    },
    {
      path: 'route/detail', // 路径
      component: () => import('@/views/cn-resource/route/detail'),
      name: 'RouteMgmtDetail', // 路由跳转name
      hidden: true,
      meta: {
        title: '路由详情',
        icon: '',
        menuKey: 'RouteMgmt',
        activeMenu: '/cn-resource/route'
      }
    },
    {
      path: 'nettopo', // 路径
      component: () => import('@/views/cn-resource/nettopo'),
      name: 'NetTopo', // 路由跳转name
      meta: {
        title: '网络拓扑',
        menuNameKey: 'NetTopo', icon: '', menuKey: 'NetTopo'
      }
    },
    {
      path: 'flow-control', // 路径
      component: () => import('@/views/cn-resource/flow-control'),
      name: 'FlowControl', // 路由跳转name
      meta: {
        title: '流量控制',
        menuNameKey: 'FlowControl', icon: '', menuKey: 'FlowControl'
      }
    },
    {
      path: 'region', // 路径
      component: () => import('@/views/cn-resource/region'),
      name: 'RegionMgmt', // 路由跳转name
      meta: {
        title: '区域管理',
        menuNameKey: 'RegionMgmt', icon: '', menuKey: 'RegionMgmt'
      }
    },
    {
      path: 'instanceType', // 路径
      component: () => import('@/views/cn-resource/instanceType'),
      name: 'InstanceTypeMgmt', // 路由跳转name
      meta: {
        title: '资源规格',
        menuNameKey: 'InstanceTypeMgmt', icon: '', menuKey: 'ResourceMgmt'
      }
    },
    {
      path: 'image', // 路径
      component: () => import('@/views/cn-resource/image'),
      name: 'ImageMgmt', // 路由跳转name
      meta: {
        title: '镜像',
        menuNameKey: 'ImageMgmt', icon: '', menuKey: 'ImageMgmt'
      }
    },
    {
      path: 'host-backup', // 路径
      component: () => import('@/views/cn-resource/host-backup'),
      name: 'HostBackup', // 路由跳转name
      meta: {
        title: '主机备份',
        menuNameKey: 'HostBackup', icon: '', menuKey: 'HostBackup'
      }
    },
    {
      path: 'host-migration', // 路径
      component: () => import('@/views/cn-resource/host-migration'),
      name: 'HostMigration', // 路由跳转name
      meta: {
        title: '主机迁移',
        menuNameKey: 'HostMigration', icon: '', menuKey: 'HostMigration'
      }
    }
  ]
}

export default cnResourceRouter
